package com.eaia.controller;

import com.eaia.model.TbContent;
import com.eaia.service.TbContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description:
 * @author: hezhiqin
 * @time: 2020/6/3 12:30
 */

@RestController
public class TbContentController {

    @Autowired
    TbContentService tbContentService;

    @PreAuthorize("hasAnyAuthority('System')")
    @RequestMapping(value = "/contents",method = RequestMethod.POST)
    public List contents(Authentication authentication){
        System.out.println("authentication.getName())"+authentication.getName());
        List<TbContent> list = tbContentService.contents();
        return list;
    }



    @RequestMapping(value = "/zuce",method = RequestMethod.POST)
    public String zhuce(){

        return "注册接口" ;
    }
}
